Skip to contentSkip to conversation

Change in openvpn[master]: Add more "intentional fallthrough" comments

Openvpn-devel In review flichtenheld (Code Review) 3 participants 8 messages Jan 14, 2025 – Mar 5, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1736860439000.I925accd8267f94ecfd9ccea85bae965dc2a10208@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/864?usp=email

to review the following change.

Change subject: Add more "intentional fallthrough" comments
......................................................................

Add more "intentional fallthrough" comments

To make it easier to exclude them from compiler
warnings.

Change-Id I925accd8267f94ecfd9ccea85bae965dc2a10208

---
M src/openvpn/list.c
M src/openvpn/push.c

2 files changed, 11 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/864/1

src/openvpn/list.c +10 -0
index 69f1510..b339c7b 100644
@@ -437,34 +437,44 @@
     {
         case 11:
             c += ((uint32_t) k[10] << 24);
+            /* Intentional [[fallthrough]]; */
 
         case 10:
             c += ((uint32_t) k[9] << 16);
+            /* Intentional [[fallthrough]]; */
 
         case 9:
             c += ((uint32_t) k[8] << 8);
+            /* Intentional [[fallthrough]]; */
 
         /* the first byte of c is reserved for the length */
         case 8:
             b += ((uint32_t) k[7] << 24);
+            /* Intentional [[fallthrough]]; */
 
         case 7:
             b += ((uint32_t) k[6] << 16);
+            /* Intentional [[fallthrough]]; */
 
         case 6:
             b += ((uint32_t) k[5] << 8);
+            /* Intentional [[fallthrough]]; */
 
         case 5:
             b += k[4];
+            /* Intentional [[fallthrough]]; */
 
         case 4:
             a += ((uint32_t) k[3] << 24);
+            /* Intentional [[fallthrough]]; */
 
         case 3:
             a += ((uint32_t) k[2] << 16);
+            /* Intentional [[fallthrough]]; */
 
         case 2:
             a += ((uint32_t) k[1] << 8);
+            /* Intentional [[fallthrough]]; */
 
         case 1:
             a += k[0];
src/openvpn/push.c +1 -0
index ddad109..06e421c 100644
@@ -98,6 +98,7 @@
 
             case AR_INTERACT:
                 ssl_purge_auth(false);
+                /* Intentional [[fallthrough]]; */
 
             case AR_NOINTERACT:
                 /* SOFT-SIGTUSR1 -- Auth failure error */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/864?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I925accd8267f94ecfd9ccea85bae965dc2a10208
Gerrit-Change-Number: 864
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/864?usp=email

to look at the new patch set (#2).

Change subject: Add more "intentional fallthrough" comments
......................................................................

Add more "intentional fallthrough" comments

To make it easier to exclude them from compiler
warnings.

Based on the existing comment in init.c

Change-Id I925accd8267f94ecfd9ccea85bae965dc2a10208

---
M src/openvpn/list.c
M src/openvpn/push.c

2 files changed, 11 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/864/2

src/openvpn/list.c +10 -0
index 69f1510..b339c7b 100644
@@ -437,34 +437,44 @@
     {
         case 11:
             c += ((uint32_t) k[10] << 24);
+            /* Intentional [[fallthrough]]; */
 
         case 10:
             c += ((uint32_t) k[9] << 16);
+            /* Intentional [[fallthrough]]; */
 
         case 9:
             c += ((uint32_t) k[8] << 8);
+            /* Intentional [[fallthrough]]; */
 
         /* the first byte of c is reserved for the length */
         case 8:
             b += ((uint32_t) k[7] << 24);
+            /* Intentional [[fallthrough]]; */
 
         case 7:
             b += ((uint32_t) k[6] << 16);
+            /* Intentional [[fallthrough]]; */
 
         case 6:
             b += ((uint32_t) k[5] << 8);
+            /* Intentional [[fallthrough]]; */
 
         case 5:
             b += k[4];
+            /* Intentional [[fallthrough]]; */
 
         case 4:
             a += ((uint32_t) k[3] << 24);
+            /* Intentional [[fallthrough]]; */
 
         case 3:
             a += ((uint32_t) k[2] << 16);
+            /* Intentional [[fallthrough]]; */
 
         case 2:
             a += ((uint32_t) k[1] << 8);
+            /* Intentional [[fallthrough]]; */
 
         case 1:
             a += k[0];
src/openvpn/push.c +1 -0
index ddad109..06e421c 100644
@@ -98,6 +98,7 @@
 
             case AR_INTERACT:
                 ssl_purge_auth(false);
+                /* Intentional [[fallthrough]]; */
 
             case AR_NOINTERACT:
                 /* SOFT-SIGTUSR1 -- Auth failure error */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/864?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I925accd8267f94ecfd9ccea85bae965dc2a10208
Gerrit-Change-Number: 864
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newpatchset

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/864?usp=email

to look at the new patch set (#3).

Change subject: Add more "intentional fallthrough" comments
......................................................................

Add more "intentional fallthrough" comments

To make it easier to exclude them from compiler
warnings.

Based on the existing comment in init.c

Change-Id I925accd8267f94ecfd9ccea85bae965dc2a10208

---
M src/openvpn/list.c
M src/openvpn/push.c

2 files changed, 11 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/864/3

src/openvpn/list.c +10 -0
index 69f1510..6987def 100644
@@ -437,34 +437,44 @@
     {
         case 11:
             c += ((uint32_t) k[10] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 10:
             c += ((uint32_t) k[9] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 9:
             c += ((uint32_t) k[8] << 8);
+        /* Intentional [[fallthrough]]; */
 
         /* the first byte of c is reserved for the length */
         case 8:
             b += ((uint32_t) k[7] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 7:
             b += ((uint32_t) k[6] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 6:
             b += ((uint32_t) k[5] << 8);
+        /* Intentional [[fallthrough]]; */
 
         case 5:
             b += k[4];
+        /* Intentional [[fallthrough]]; */
 
         case 4:
             a += ((uint32_t) k[3] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 3:
             a += ((uint32_t) k[2] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 2:
             a += ((uint32_t) k[1] << 8);
+        /* Intentional [[fallthrough]]; */
 
         case 1:
             a += k[0];
src/openvpn/push.c +1 -0
index ddad109..914f520 100644
@@ -98,6 +98,7 @@
 
             case AR_INTERACT:
                 ssl_purge_auth(false);
+            /* Intentional [[fallthrough]]; */
 
             case AR_NOINTERACT:
                 /* SOFT-SIGTUSR1 -- Auth failure error */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/864?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I925accd8267f94ecfd9ccea85bae965dc2a10208
Gerrit-Change-Number: 864
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newpatchset

#4 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld.

plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/864?usp=email )

Change subject: Add more "intentional fallthrough" comments
......................................................................

Patch Set 3: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/864?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I925accd8267f94ecfd9ccea85bae965dc2a10208
Gerrit-Change-Number: 864
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Sun, 16 Feb 2025 15:04:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#5 lore raw

PATCH v3 1/1 Add more "intentional fallthrough" comments

In reply to a message not in the archive

To make it easier to exclude them from compiler
warnings.

Based on the existing comment in init.c

Change-Id I925accd8267f94ecfd9ccea85bae965dc2a10208

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/864
This mail reflects revision 3 of this Change.

Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]...>

src/openvpn/list.c +10 -0
index 69f1510..6987def 100644
@@ -437,34 +437,44 @@
     {
         case 11:
             c += ((uint32_t) k[10] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 10:
             c += ((uint32_t) k[9] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 9:
             c += ((uint32_t) k[8] << 8);
+        /* Intentional [[fallthrough]]; */
 
         /* the first byte of c is reserved for the length */
         case 8:
             b += ((uint32_t) k[7] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 7:
             b += ((uint32_t) k[6] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 6:
             b += ((uint32_t) k[5] << 8);
+        /* Intentional [[fallthrough]]; */
 
         case 5:
             b += k[4];
+        /* Intentional [[fallthrough]]; */
 
         case 4:
             a += ((uint32_t) k[3] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 3:
             a += ((uint32_t) k[2] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 2:
             a += ((uint32_t) k[1] << 8);
+        /* Intentional [[fallthrough]]; */
 
         case 1:
             a += k[0];
src/openvpn/push.c +1 -0
index ddad109..914f520 100644
@@ -98,6 +98,7 @@
 
             case AR_INTERACT:
                 ssl_purge_auth(false);
+            /* Intentional [[fallthrough]]; */
 
             case AR_NOINTERACT:
                 /* SOFT-SIGTUSR1 -- Auth failure error */
#6 lore raw

[Openvpn-devel] [PATCH applied] Re: Add more 'intentional fallthrough' comments

Thanks for this. Helping the compiler see the intentions vs. a forgotten "break" is a good long-term strategy, I'd say :-)

Your patch has been applied to the master branch.

commit fed37d003d9cbc9e7c3ea5fdd0f0a287f4cee538

Author: Frank Lichtenheld
Date:   Fri Feb 28 18:02:32 2025 +0100
     Add more 'intentional fallthrough' comments

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg30990.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#7 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Add more 'intentional fallthrough' comments

In reply to a message not in the archive

cron2 has uploaded a new patch set (#4) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/864?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos

Change subject: Add more 'intentional fallthrough' comments
......................................................................

Add more 'intentional fallthrough' comments

To make it easier to exclude them from compiler
warnings.

Based on the existing comment in init.c

Change-Id I925accd8267f94ecfd9ccea85bae965dc2a10208

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg30990.html

---
M src/openvpn/list.c
M src/openvpn/push.c

2 files changed, 11 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/864/4

src/openvpn/list.c +10 -0
index 69f1510..6987def 100644
@@ -437,34 +437,44 @@
     {
         case 11:
             c += ((uint32_t) k[10] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 10:
             c += ((uint32_t) k[9] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 9:
             c += ((uint32_t) k[8] << 8);
+        /* Intentional [[fallthrough]]; */
 
         /* the first byte of c is reserved for the length */
         case 8:
             b += ((uint32_t) k[7] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 7:
             b += ((uint32_t) k[6] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 6:
             b += ((uint32_t) k[5] << 8);
+        /* Intentional [[fallthrough]]; */
 
         case 5:
             b += k[4];
+        /* Intentional [[fallthrough]]; */
 
         case 4:
             a += ((uint32_t) k[3] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 3:
             a += ((uint32_t) k[2] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 2:
             a += ((uint32_t) k[1] << 8);
+        /* Intentional [[fallthrough]]; */
 
         case 1:
             a += k[0];
src/openvpn/push.c +1 -0
index a7cd3bf..80f9065 100644
@@ -98,6 +98,7 @@
 
             case AR_INTERACT:
                 ssl_purge_auth(false);
+            /* Intentional [[fallthrough]]; */
 
             case AR_NOINTERACT:
                 /* SOFT-SIGTUSR1 -- Auth failure error */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/864?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I925accd8267f94ecfd9ccea85bae965dc2a10208
Gerrit-Change-Number: 864
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#8 lore raw

[Openvpn-devel] [S] Change in openvpn[master]: Add more 'intentional fallthrough' comments

In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/864?usp=email )

Change subject: Add more 'intentional fallthrough' comments
......................................................................

Add more 'intentional fallthrough' comments

To make it easier to exclude them from compiler
warnings.

Based on the existing comment in init.c

Change-Id I925accd8267f94ecfd9ccea85bae965dc2a10208

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg30990.html

---
M src/openvpn/list.c
M src/openvpn/push.c

2 files changed, 11 insertions(+), 0 deletions(-)
src/openvpn/list.c +10 -0
index 69f1510..6987def 100644
@@ -437,34 +437,44 @@
     {
         case 11:
             c += ((uint32_t) k[10] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 10:
             c += ((uint32_t) k[9] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 9:
             c += ((uint32_t) k[8] << 8);
+        /* Intentional [[fallthrough]]; */
 
         /* the first byte of c is reserved for the length */
         case 8:
             b += ((uint32_t) k[7] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 7:
             b += ((uint32_t) k[6] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 6:
             b += ((uint32_t) k[5] << 8);
+        /* Intentional [[fallthrough]]; */
 
         case 5:
             b += k[4];
+        /* Intentional [[fallthrough]]; */
 
         case 4:
             a += ((uint32_t) k[3] << 24);
+        /* Intentional [[fallthrough]]; */
 
         case 3:
             a += ((uint32_t) k[2] << 16);
+        /* Intentional [[fallthrough]]; */
 
         case 2:
             a += ((uint32_t) k[1] << 8);
+        /* Intentional [[fallthrough]]; */
 
         case 1:
             a += k[0];
src/openvpn/push.c +1 -0
index a7cd3bf..80f9065 100644
@@ -98,6 +98,7 @@
 
             case AR_INTERACT:
                 ssl_purge_auth(false);
+            /* Intentional [[fallthrough]]; */
 
             case AR_NOINTERACT:
                 /* SOFT-SIGTUSR1 -- Auth failure error */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/864?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I925accd8267f94ecfd9ccea85bae965dc2a10208
Gerrit-Change-Number: 864
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged